Release 10.1A: OpenEdge Development:
Programming Interfaces
Positioning database references in an application
If possible, isolate database references within your application to help minimize the effects of a database connection failure on your application. This allows you to use the
CONNECTEDfunction effectively to test for a particular database connection, prior to passing program control to a subprocedure that accesses that database.mainproc.pdb1proc.pdb2proc.pFigure 1–9: Positioning database references
![]()
Figure 1–9 shows a main procedure that connects two databases and runs subprocedures, depending on whether or not a database is connected. If the
CONNECTstatement inmainproc.pfails to connect db2, onlydb2proc.psubprocedure is effected by the database connection failure. This technique is useful for applications that run subprocedures from a menu.Do not reference a database in your application startup procedure, except possibly to connect it. Remember, you cannot connect to a database and reference a database in the same procedure. If you reference a database on an auto-connect list within the startup procedure of your application and the auto-connect fails for that database, the startup procedure does not run.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |